package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.Menu;

import java.util.List;

/**
 * @Description 菜单持久层访问接口
 * @Author makun
 * @Date 2023/9/26 19:20
 * @Version 1.0
 */
public interface MenuMapper extends BaseMapper<Menu> {
    /**
     * 根据用户ID查询该用户所拥有的菜单
     * @param userId 用户ID
     * @return
     */
    List<Menu> selectMenuByUserIdWithTree(Integer userId);

    /**
     * 查询树结构的菜单
     * @return
     */
    List<Menu> selectAllMenuToTree();
}
